package com.spc.redis.configurer;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * @author alex
 * @version v1.0 2021/3/18
 */
@ConfigurationProperties(prefix = "mlog.redis-client")
public class RedisClientProperties {

    /**
     * hutool/gson/jackson/fastjson default is `gson`
     */
    private String serializerType = "gson";

    /**
     * 默认存活时间为 48h
     */
    private Duration ttl = Duration.ofHours(48);


    public String getSerializerType() {
        return serializerType;
    }

    public RedisClientProperties setSerializerType(String serializerType) {
        this.serializerType = serializerType;
        return this;
    }

    public Duration getTtl() {
        return ttl;
    }

    public RedisClientProperties setTtl(Duration ttl) {
        this.ttl = ttl;
        return this;
    }
}
